$(function () {
    $('#discuss-box').keydown(function (event) {
        if (event.keyCode == 13) {
            var text = $(this).val();
            var url = "http://oldpub.cn:9501/?s=index/chat/index";
            var data = {'content':text,'game_id':1};
            $.post(url,data,function(data){
                if (data.status ==1){
                    alert(data.msg);
                    $('#discuss-box').val('');
                } else{
                    alert(data.msg);
                    $('#discuss-box').val('');
                    return;
                }
            },'json')
        }
    })
})